<template>
  <el-image
      :src="coverImgUrl"
      fit="cover"
      style="width: 80px; height: 120px"
      :preview-src-list="rePreviewSrcList"
      preview-teleported="true"
  />
</template>
<script setup>
import {imgUrl} from "@/utils/http.js";
import {computed,ref} from "vue";

const props = defineProps({
  src: String,
  previewSrcList: Array
})
const rePreviewSrcList = ref([])
console.log(props)
const coverImgUrl = computed(() => {
  //判断是是http开头的
  if (props.src.startsWith('http')) {
    return props.src
  } else {
    rePreviewSrcList.value = props.previewSrcList.map(item => {
      return imgUrl+item
    })
    return imgUrl+props.src
  }
})
</script>